<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="cfn" uri="http://ctstudio.com/jsp/jstl/functions"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href='<spring:url value="/resources/images/favicon.ico"/>' />
<link href='<spring:url value="/resources/bootstrap/css/bootstrap.min.css"/>' rel="stylesheet" />
<link href='<spring:url value="/resources/css/full.css"/>' rel="stylesheet" />
<script type="text/javascript" src='<c:url value="/resources/js/3rd/require.min.js" />'
	data-main='<spring:url value="/resources/js/sign/list.js"/>'></script>
<title>考勤记录-考勤系统</title>
</head>
<body>
	<div class="container">
		<c:set var="pageType" value="list" scope="request" />
		<jsp:include page="../topMenu.jsp" />
		<div class="panel panel-default">
			<div class="panel-heading">考勤记录</div>
			<table class="table table-striped table-hover">
				<thead>
					<tr>
						<th>工号/姓名</th>
						<th>上班</th>
						<th>下班</th>
						<th>有效</th>
						<th>加班</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="entry" items="${map.entrySet()}">
						<tr class="active">
							<th colspan="10">${entry.key}</th>
						</tr>
						<c:forEach var="info" items="${entry.value}">
							<c:choose>
								<c:when test="${info.exception}">
									<c:set var="trClass" value="warning" />
								</c:when>
								<c:when test="${info.late}">
									<c:set var="trClass" value="danger" />
								</c:when>
								<c:otherwise>
									<c:set var="trClass" value="" />
								</c:otherwise>
							</c:choose>
							<tr class="${trClass}">
								<td><a name="${info.uid}"></a> <c:out value="${info.uid}" />/<c:out value="${staffMap.get(info.uid)}" /></td>
								<td><c:if test="${info.signInTime!=null}">
										${info.signInTime}
									</c:if></td>
								<td><c:if test="${info.signOutTime!=null}">
										${info.signOutTime}
									</c:if></td>
								<td>${info.workTime}</td>
								<td>${info.overTime}</td>
							</tr>
						</c:forEach>
					</c:forEach>
				</tbody>
			</table>
			<div class="panel-footer">
				<c:set var="totalPage" value="${cfn:roundUp(total/query.s)}" />
				共${total}条，
				<c:if test="${query.p>1}">
					<a id="prev">上一页</a>
				</c:if>
				${query.p}/${totalPage}
				<c:if test="${query.p<totalPage}">
					<a id="next">下一页</a>
				</c:if>
			</div>
		</div>
	</div>
</body>
</html>